<template>
  <div class="wares">
    <div class="image">
      <img src="../assets/miao.png" />
    </div>
    <div class="van-multi-ellipsis--l2 title">asdjasld</div>
    <div class="footer">
      <div class="price">
        <div class="unit">￥</div>
        <div>123</div>
      </div>
    </div>
  </div>
</template>

<script>
import { mapMutations, mapState } from "vuex";

export default {
  props: {
    s: {
      type: Object,
      default() {
        return {};
      },
    },
  },
  computed: {
    ...mapState(["baseURL"]),
  },
  methods: {
    ...mapMutations(["setAddresinfo"]),
    /**
     * 去详情页面
     */
    toDetails() {
      this.setAddresinfo({});
      this.$router.push(`/details/${this.s.id}`);
    },
  },
};
</script>

<style lang='less' scoped>
.wares {
  position: relative;
  padding-bottom: 0.6rem;
  background: rgba(255, 255, 255, 1);
  border-radius: 0.36rem;

  .image {
    .fj(center);

    img {
      display: block;
      max-width: 100%;
      height: 6.84rem;
      border-radius: 0.36rem 0.36rem 0 0;
    }
  }

  .title {
    margin: 0.16rem 0.32rem 0.28rem;
    max-height: 1.44rem;
    font-size: 0.52rem;
    line-height: 0.72rem;
    font-family: PingFangSC-Regular, PingFang SC;
    font-weight: 400;
    color: rgba(44, 42, 41, 1);
  }

  .footer {
    padding: 0 0.28rem;
    .flex(space-between, center);

    .price {
      font-size: 0.56rem;
      line-height: 0.56rem;
      font-family: STZhongsong;
      color: rgba(196, 66, 66, 1);
      .fa(flex-end);

      .unit {
        font-size: 0.48rem;
        line-height: 0.48rem;
      }
    }
  }
}
</style>
